/*
 * ConsultarLinea.java
 *
 * Created on 15-oct-2008, 12:54:21
 */
package investigaciones_itm.LineasInvestigacion;

import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.DropDown;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.HiddenField;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Hyperlink;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.PanelLayout;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.Tab;
import com.sun.webui.jsf.component.TabSet;
import com.sun.webui.jsf.component.Table;
import com.sun.webui.jsf.component.TableColumn;
import com.sun.webui.jsf.component.TableRowGroup;
import com.sun.webui.jsf.component.Upload;
import com.sun.webui.jsf.model.Option;
import com.sun.webui.jsf.model.UploadedFile;
import itm.exception.ArchivoException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.FacesException;
import investigaciones_itm.SessionBean1;
import investigaciones_itm.RequestBean1;
import investigaciones_itm.ApplicationBean1;
import investigaciones_itm.upload.Archivo;
import itm.base.ListaTablaPares;
import itm.bo.lineaInvestigacion.LineaInvestigacionBO;
import itm.vo.file.ArchivoVO;
import itm.vo.grupoInvestigacion.GrupoInvestigacionVO;
import itm.vo.lineaInvestigacion.LineaInvestigacionTO;
import itm.vo.lineaInvestigacion.LineaInvestigacionVO;
import itm.vo.lineaInvestigacion.ParAcademicoVO;
import itm.vo.personas.PersonaVO;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlInputHidden;
import javax.faces.component.html.HtmlInputText;
import javax.faces.component.html.HtmlInputTextarea;
import javax.faces.component.html.HtmlMessages;
import javax.faces.component.html.HtmlOutputText;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import static itm.constants.FileConstants.*;

/**
 * <p>Page bean that corresponds to a similarly named JSP page.  This
 * class contains component definitions (and initialization code) for
 * all components that you have defined on this page, as well as
 * lifecycle methods and event handlers where you may add behavior
 * to respond to incoming events.</p>
 *
 * @author Administrador
 */
public class ConsultarLinea extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">

    /**
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
    }
    private Page page1 = new Page();

    public Page getPage1() {
        return page1;
    }

    public void setPage1(Page p) {
        this.page1 = p;
    }
    private Html html1 = new Html();

    public Html getHtml1() {
        return html1;
    }

    public void setHtml1(Html h) {
        this.html1 = h;
    }
    private Head head1 = new Head();

    public Head getHead1() {
        return head1;
    }

    public void setHead1(Head h) {
        this.head1 = h;
    }
    private Link link1 = new Link();

    public Link getLink1() {
        return link1;
    }

    public void setLink1(Link l) {
        this.link1 = l;
    }
    private Body body1 = new Body();

    public Body getBody1() {
        return body1;
    }

    public void setBody1(Body b) {
        this.body1 = b;
    }
    private Form form1 = new Form();

    public Form getForm1() {
        return form1;
    }

    public void setForm1(Form f) {
        this.form1 = f;
    }
    private HtmlPanelGrid gridPanel1 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel1() {
        return gridPanel1;
    }

    public void setGridPanel1(HtmlPanelGrid hpg) {
        this.gridPanel1 = hpg;
    }
    private TabSet tabSet1 = new TabSet();

    public TabSet getTabSet1() {
        return tabSet1;
    }

    public void setTabSet1(TabSet ts) {
        this.tabSet1 = ts;
    }
    private Tab tab1 = new Tab();

    public Tab getTab1() {
        return tab1;
    }

    public void setTab1(Tab t) {
        this.tab1 = t;
    }
    private PanelLayout layoutPanel1 = new PanelLayout();

    public PanelLayout getLayoutPanel1() {
        return layoutPanel1;
    }

    public void setLayoutPanel1(PanelLayout pl) {
        this.layoutPanel1 = pl;
    }
    private HtmlPanelGrid gridPanel2 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel2() {
        return gridPanel2;
    }

    public void setGridPanel2(HtmlPanelGrid hpg) {
        this.gridPanel2 = hpg;
    }
    private HtmlPanelGrid gridPanel3 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel3() {
        return gridPanel3;
    }

    public void setGridPanel3(HtmlPanelGrid hpg) {
        this.gridPanel3 = hpg;
    }
    private HtmlPanelGrid gridPanel6 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel6() {
        return gridPanel6;
    }

    public void setGridPanel6(HtmlPanelGrid hpg) {
        this.gridPanel6 = hpg;
    }
    private HtmlPanelGrid gridPanel7 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel7() {
        return gridPanel7;
    }

    public void setGridPanel7(HtmlPanelGrid hpg) {
        this.gridPanel7 = hpg;
    }
    private HtmlPanelGrid gridPanel8 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel8() {
        return gridPanel8;
    }

    public void setGridPanel8(HtmlPanelGrid hpg) {
        this.gridPanel8 = hpg;
    }
    private HtmlPanelGrid gridPanel9 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel9() {
        return gridPanel9;
    }

    public void setGridPanel9(HtmlPanelGrid hpg) {
        this.gridPanel9 = hpg;
    }
    private HtmlPanelGrid gridPanel12 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel12() {
        return gridPanel12;
    }

    public void setGridPanel12(HtmlPanelGrid hpg) {
        this.gridPanel12 = hpg;
    }
    private HtmlPanelGrid gridPanel15 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel15() {
        return gridPanel15;
    }

    public void setGridPanel15(HtmlPanelGrid hpg) {
        this.gridPanel15 = hpg;
    }
    private HtmlPanelGrid gridPanel16 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel16() {
        return gridPanel16;
    }

    public void setGridPanel16(HtmlPanelGrid hpg) {
        this.gridPanel16 = hpg;
    }
    private HtmlPanelGrid gridPanel17 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel17() {
        return gridPanel17;
    }

    public void setGridPanel17(HtmlPanelGrid hpg) {
        this.gridPanel17 = hpg;
    }
    private HtmlCommandButton buttonConsultarLinea = new HtmlCommandButton();

    public HtmlCommandButton getButtonConsultarLinea() {
        return buttonConsultarLinea;
    }

    public void setButtonConsultarLinea(HtmlCommandButton hcb) {
        this.buttonConsultarLinea = hcb;
    }
    private HtmlCommandButton buttonActualizar = new HtmlCommandButton();

    public HtmlCommandButton getButtonActualizar() {
        return buttonActualizar;
    }

    public void setButtonActualizar(HtmlCommandButton hcb) {
        this.buttonActualizar = hcb;
    }
    private HtmlCommandButton buttonAdministrar = new HtmlCommandButton();

    public HtmlCommandButton getButtonAdministrar() {
        return buttonAdministrar;
    }

    public void setButtonAdministrar(HtmlCommandButton hcb) {
        this.buttonAdministrar = hcb;
    }
    private HtmlOutputText outpuNombre = new HtmlOutputText();

    public HtmlOutputText getOutpuNombre() {
        return outpuNombre;
    }

    public void setOutpuNombre(HtmlOutputText hot) {
        this.outpuNombre = hot;
    }
    private HtmlInputText textFieldNombre = new HtmlInputText();

    public HtmlInputText getTextFieldNombre() {
        return textFieldNombre;
    }

    public void setTextFieldNombre(HtmlInputText hit) {
        this.textFieldNombre = hit;
    }
    private Table tablaLineas = new Table();

    public Table getTablaLineas() {
        return tablaLineas;
    }

    public void setTablaLineas(Table t) {
        this.tablaLineas = t;
    }
    private TableRowGroup tableRowGroup1 = new TableRowGroup();

    public TableRowGroup getTableRowGroup1() {
        return tableRowGroup1;
    }

    public void setTableRowGroup1(TableRowGroup trg) {
        this.tableRowGroup1 = trg;
    }
    private TableColumn tableColumn4 = new TableColumn();

    public TableColumn getTableColumn4() {
        return tableColumn4;
    }

    public void setTableColumn4(TableColumn tc) {
        this.tableColumn4 = tc;
    }
    private StaticText staticText4 = new StaticText();

    public StaticText getStaticText4() {
        return staticText4;
    }

    public void setStaticText4(StaticText st) {
        this.staticText4 = st;
    }
    private TableColumn tableColumn5 = new TableColumn();

    public TableColumn getTableColumn5() {
        return tableColumn5;
    }

    public void setTableColumn5(TableColumn tc) {
        this.tableColumn5 = tc;
    }
    private StaticText staticText5 = new StaticText();

    public StaticText getStaticText5() {
        return staticText5;
    }

    public void setStaticText5(StaticText st) {
        this.staticText5 = st;
    }
    private TableColumn tableColumn6 = new TableColumn();

    public TableColumn getTableColumn6() {
        return tableColumn6;
    }

    public void setTableColumn6(TableColumn tc) {
        this.tableColumn6 = tc;
    }
    private StaticText staticText6 = new StaticText();

    public StaticText getStaticText6() {
        return staticText6;
    }

    public void setStaticText6(StaticText st) {
        this.staticText6 = st;
    }
    private TableColumn tableColumn1 = new TableColumn();

    public TableColumn getTableColumn1() {
        return tableColumn1;
    }

    public void setTableColumn1(TableColumn tc) {
        this.tableColumn1 = tc;
    }
    private Button botonVer = new Button();

    public Button getBotonVer() {
        return botonVer;
    }

    public void setBotonVer(Button b) {
        this.botonVer = b;
    }
    private HtmlPanelGrid gridPanel10 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel10() {
        return gridPanel10;
    }

    public void setGridPanel10(HtmlPanelGrid hpg) {
        this.gridPanel10 = hpg;
    }
    private HtmlPanelGrid gridPanel11 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel11() {
        return gridPanel11;
    }

    public void setGridPanel11(HtmlPanelGrid hpg) {
        this.gridPanel11 = hpg;
    }
    private HtmlPanelGrid gridPanel13 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel13() {
        return gridPanel13;
    }

    public void setGridPanel13(HtmlPanelGrid hpg) {
        this.gridPanel13 = hpg;
    }
    private HtmlPanelGrid gridPanel14 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel14() {
        return gridPanel14;
    }

    public void setGridPanel14(HtmlPanelGrid hpg) {
        this.gridPanel14 = hpg;
    }
    private HtmlPanelGrid gridPanel18 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel18() {
        return gridPanel18;
    }

    public void setGridPanel18(HtmlPanelGrid hpg) {
        this.gridPanel18 = hpg;
    }
    private HtmlPanelGrid gridPanel19 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel19() {
        return gridPanel19;
    }

    public void setGridPanel19(HtmlPanelGrid hpg) {
        this.gridPanel19 = hpg;
    }
    private HtmlPanelGrid gridPanel20 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel20() {
        return gridPanel20;
    }

    public void setGridPanel20(HtmlPanelGrid hpg) {
        this.gridPanel20 = hpg;
    }
    private HtmlOutputText outputText1 = new HtmlOutputText();

    public HtmlOutputText getOutputText1() {
        return outputText1;
    }

    public void setOutputText1(HtmlOutputText hot) {
        this.outputText1 = hot;
    }
    private HtmlOutputText outputText2 = new HtmlOutputText();

    public HtmlOutputText getOutputText2() {
        return outputText2;
    }

    public void setOutputText2(HtmlOutputText hot) {
        this.outputText2 = hot;
    }
    private HtmlOutputText outputText3 = new HtmlOutputText();

    public HtmlOutputText getOutputText3() {
        return outputText3;
    }

    public void setOutputText3(HtmlOutputText hot) {
        this.outputText3 = hot;
    }
    private HtmlOutputText outputText4 = new HtmlOutputText();

    public HtmlOutputText getOutputText4() {
        return outputText4;
    }

    public void setOutputText4(HtmlOutputText hot) {
        this.outputText4 = hot;
    }
    private HtmlInputTextarea areaNombreLinea = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaNombreLinea() {
        return areaNombreLinea;
    }

    public void setAreaNombreLinea(HtmlInputTextarea hit) {
        this.areaNombreLinea = hit;
    }
    private HtmlInputTextarea areaJustificacion = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaJustificacion() {
        return areaJustificacion;
    }

    public void setAreaJustificacion(HtmlInputTextarea hit) {
        this.areaJustificacion = hit;
    }
    private HtmlInputTextarea areaPosProy = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaPosProy() {
        return areaPosProy;
    }

    public void setAreaPosProy(HtmlInputTextarea hit) {
        this.areaPosProy = hit;
    }
    private HtmlPanelGrid gridPanel23 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel23() {
        return gridPanel23;
    }

    public void setGridPanel23(HtmlPanelGrid hpg) {
        this.gridPanel23 = hpg;
    }
    private HtmlPanelGrid gridPanel24 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel24() {
        return gridPanel24;
    }

    public void setGridPanel24(HtmlPanelGrid hpg) {
        this.gridPanel24 = hpg;
    }
    private HtmlOutputText outputText6 = new HtmlOutputText();

    public HtmlOutputText getOutputText6() {
        return outputText6;
    }

    public void setOutputText6(HtmlOutputText hot) {
        this.outputText6 = hot;
    }
    private HtmlInputTextarea areaPersEpist = new HtmlInputTextarea();

    public HtmlInputTextarea getAreaPersEpist() {
        return areaPersEpist;
    }

    public void setAreaPersEpist(HtmlInputTextarea hit) {
        this.areaPersEpist = hit;
    }
    private HiddenField hiddenIdLinea = new HiddenField();

    public HiddenField getHiddenIdLinea() {
        return hiddenIdLinea;
    }

    public void setHiddenIdLinea(HiddenField hf) {
        this.hiddenIdLinea = hf;
    }
    private Tab tab2 = new Tab();

    public Tab getTab2() {
        return tab2;
    }

    public void setTab2(Tab t) {
        this.tab2 = t;
    }
    private PanelLayout layoutPanel3 = new PanelLayout();

    public PanelLayout getLayoutPanel3() {
        return layoutPanel3;
    }

    public void setLayoutPanel3(PanelLayout pl) {
        this.layoutPanel3 = pl;
    }
    private HtmlPanelGrid gridPanel27 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel27() {
        return gridPanel27;
    }

    public void setGridPanel27(HtmlPanelGrid hpg) {
        this.gridPanel27 = hpg;
    }
    private HtmlPanelGrid gridPanel28 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel28() {
        return gridPanel28;
    }

    public void setGridPanel28(HtmlPanelGrid hpg) {
        this.gridPanel28 = hpg;
    }
    private HtmlPanelGrid gridPanel30 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel30() {
        return gridPanel30;
    }

    public void setGridPanel30(HtmlPanelGrid hpg) {
        this.gridPanel30 = hpg;
    }
    private HtmlPanelGrid gridPanel31 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel31() {
        return gridPanel31;
    }

    public void setGridPanel31(HtmlPanelGrid hpg) {
        this.gridPanel31 = hpg;
    }
    private HtmlPanelGrid gridPanel32 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel32() {
        return gridPanel32;
    }

    public void setGridPanel32(HtmlPanelGrid hpg) {
        this.gridPanel32 = hpg;
    }
    private HtmlPanelGrid gridPanel33 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel33() {
        return gridPanel33;
    }

    public void setGridPanel33(HtmlPanelGrid hpg) {
        this.gridPanel33 = hpg;
    }
    private HtmlPanelGrid gridPanel34 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel34() {
        return gridPanel34;
    }

    public void setGridPanel34(HtmlPanelGrid hpg) {
        this.gridPanel34 = hpg;
    }
    private HtmlPanelGrid gridPanel35 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel35() {
        return gridPanel35;
    }

    public void setGridPanel35(HtmlPanelGrid hpg) {
        this.gridPanel35 = hpg;
    }
    private HtmlPanelGrid gridPanel36 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel36() {
        return gridPanel36;
    }

    public void setGridPanel36(HtmlPanelGrid hpg) {
        this.gridPanel36 = hpg;
    }
    private HtmlPanelGrid gridPanel37 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel37() {
        return gridPanel37;
    }

    public void setGridPanel37(HtmlPanelGrid hpg) {
        this.gridPanel37 = hpg;
    }
    private HtmlPanelGrid gridPanel38 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel38() {
        return gridPanel38;
    }

    public void setGridPanel38(HtmlPanelGrid hpg) {
        this.gridPanel38 = hpg;
    }
    private HtmlPanelGrid gridPanel39 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel39() {
        return gridPanel39;
    }

    public void setGridPanel39(HtmlPanelGrid hpg) {
        this.gridPanel39 = hpg;
    }
    private HtmlPanelGrid gridPanel40 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel40() {
        return gridPanel40;
    }

    public void setGridPanel40(HtmlPanelGrid hpg) {
        this.gridPanel40 = hpg;
    }
    private HtmlPanelGrid gridPanel41 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel41() {
        return gridPanel41;
    }

    public void setGridPanel41(HtmlPanelGrid hpg) {
        this.gridPanel41 = hpg;
    }
    private HtmlPanelGrid gridPanel42 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel42() {
        return gridPanel42;
    }

    public void setGridPanel42(HtmlPanelGrid hpg) {
        this.gridPanel42 = hpg;
    }
    private HtmlPanelGrid gridPanel43 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel43() {
        return gridPanel43;
    }

    public void setGridPanel43(HtmlPanelGrid hpg) {
        this.gridPanel43 = hpg;
    }
    private HtmlPanelGrid gridPanel44 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel44() {
        return gridPanel44;
    }

    public void setGridPanel44(HtmlPanelGrid hpg) {
        this.gridPanel44 = hpg;
    }
    private HtmlPanelGrid gridPanel45 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel45() {
        return gridPanel45;
    }

    public void setGridPanel45(HtmlPanelGrid hpg) {
        this.gridPanel45 = hpg;
    }
    private HtmlOutputText outputText8 = new HtmlOutputText();

    public HtmlOutputText getOutputText8() {
        return outputText8;
    }

    public void setOutputText8(HtmlOutputText hot) {
        this.outputText8 = hot;
    }
    private HtmlOutputText outputText9 = new HtmlOutputText();

    public HtmlOutputText getOutputText9() {
        return outputText9;
    }

    public void setOutputText9(HtmlOutputText hot) {
        this.outputText9 = hot;
    }
    private HtmlOutputText outputText10 = new HtmlOutputText();

    public HtmlOutputText getOutputText10() {
        return outputText10;
    }

    public void setOutputText10(HtmlOutputText hot) {
        this.outputText10 = hot;
    }
    private HtmlOutputText outputText11 = new HtmlOutputText();

    public HtmlOutputText getOutputText11() {
        return outputText11;
    }

    public void setOutputText11(HtmlOutputText hot) {
        this.outputText11 = hot;
    }
    private Upload fileUploadLinea = new Upload();

    public Upload getFileUploadLinea() {
        return fileUploadLinea;
    }

    public void setFileUploadLinea(Upload u) {
        this.fileUploadLinea = u;
    }
    private HtmlCommandButton botonAdjuntar = new HtmlCommandButton();

    public HtmlCommandButton getBotonAdjuntar() {
        return botonAdjuntar;
    }

    public void setBotonAdjuntar(HtmlCommandButton hcb) {
        this.botonAdjuntar = hcb;
    }
    private HtmlOutputText outputText12 = new HtmlOutputText();

    public HtmlOutputText getOutputText12() {
        return outputText12;
    }

    public void setOutputText12(HtmlOutputText hot) {
        this.outputText12 = hot;
    }
    private HtmlOutputText outputText13 = new HtmlOutputText();

    public HtmlOutputText getOutputText13() {
        return outputText13;
    }

    public void setOutputText13(HtmlOutputText hot) {
        this.outputText13 = hot;
    }
    private HtmlCommandButton botonGuardar = new HtmlCommandButton();

    public HtmlCommandButton getBotonGuardar() {
        return botonGuardar;
    }

    public void setBotonGuardar(HtmlCommandButton hcb) {
        this.botonGuardar = hcb;
    }
    private HtmlCommandButton botonVolver = new HtmlCommandButton();

    public HtmlCommandButton getBotonVolver() {
        return botonVolver;
    }

    public void setBotonVolver(HtmlCommandButton hcb) {
        this.botonVolver = hcb;
    }
    private HtmlInputText textFieldArchivo = new HtmlInputText();

    public HtmlInputText getTextFieldArchivo() {
        return textFieldArchivo;
    }

    public void setTextFieldArchivo(HtmlInputText hit) {
        this.textFieldArchivo = hit;
    }
    private HtmlInputText textFieldFecha = new HtmlInputText();

    public HtmlInputText getTextFieldFecha() {
        textFieldFecha = new HtmlInputText();
        java.util.Date fechaActual = new java.util.Date();
        fechaActual = new Date(fechaActual.getTime());
        textFieldFecha.setValue(fechaActual);
        return textFieldFecha;
    }

    public void setTextFieldFecha(HtmlInputText hit) {
        this.textFieldFecha = hit;
    }
    private HtmlInputTextarea textAreaDescripcion = new HtmlInputTextarea();

    public HtmlInputTextarea getTextAreaDescripcion() {
        return textAreaDescripcion;
    }

    public void setTextAreaDescripcion(HtmlInputTextarea hit) {
        this.textAreaDescripcion = hit;
    }
    private HtmlInputText textFieldNombreArchivo = new HtmlInputText();

    public HtmlInputText getTextFieldNombreArchivo() {
        return textFieldNombreArchivo;
    }

    public void setTextFieldNombreArchivo(HtmlInputText hit) {
        this.textFieldNombreArchivo = hit;
    }
    private HtmlInputTextarea textAreaNombreLinea = new HtmlInputTextarea();

    public HtmlInputTextarea getTextAreaNombreLinea() {
        return textAreaNombreLinea;
    }

    public void setTextAreaNombreLinea(HtmlInputTextarea hit) {
        this.textAreaNombreLinea = hit;
    }
    private HtmlInputText textFieldIdLinea = new HtmlInputText();

    public HtmlInputText getTextFieldIdLinea() {
        return textFieldIdLinea;
    }

    public void setTextFieldIdLinea(HtmlInputText hit) {
        this.textFieldIdLinea = hit;
    }
    private HtmlPanelGrid gridPanel46 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel46() {
        return gridPanel46;
    }

    public void setGridPanel46(HtmlPanelGrid hpg) {
        this.gridPanel46 = hpg;
    }
    private HtmlPanelGrid gridPanel47 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel47() {
        return gridPanel47;
    }

    public void setGridPanel47(HtmlPanelGrid hpg) {
        this.gridPanel47 = hpg;
    }
    private HtmlPanelGrid gridPanel50 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel50() {
        return gridPanel50;
    }

    public void setGridPanel50(HtmlPanelGrid hpg) {
        this.gridPanel50 = hpg;
    }
    private HtmlPanelGrid gridPanel51 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel51() {
        return gridPanel51;
    }

    public void setGridPanel51(HtmlPanelGrid hpg) {
        this.gridPanel51 = hpg;
    }
    private HtmlPanelGrid gridPanel52 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel52() {
        return gridPanel52;
    }

    public void setGridPanel52(HtmlPanelGrid hpg) {
        this.gridPanel52 = hpg;
    }
    private HtmlPanelGrid gridPanel53 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel53() {
        return gridPanel53;
    }

    public void setGridPanel53(HtmlPanelGrid hpg) {
        this.gridPanel53 = hpg;
    }
    private HtmlOutputText outputText14 = new HtmlOutputText();

    public HtmlOutputText getOutputText14() {
        return outputText14;
    }

    public void setOutputText14(HtmlOutputText hot) {
        this.outputText14 = hot;
    }
    private HtmlOutputText outputText16 = new HtmlOutputText();

    public HtmlOutputText getOutputText16() {
        return outputText16;
    }

    public void setOutputText16(HtmlOutputText hot) {
        this.outputText16 = hot;
    }
    private HtmlOutputText outputText17 = new HtmlOutputText();

    public HtmlOutputText getOutputText17() {
        return outputText17;
    }

    public void setOutputText17(HtmlOutputText hot) {
        this.outputText17 = hot;
    }
    private HtmlInputText textFieldFecha1 = new HtmlInputText();

    public HtmlInputText getTextFieldFecha1() {
        return textFieldFecha1;
    }

    public void setTextFieldFecha1(HtmlInputText hit) {
        this.textFieldFecha1 = hit;
    }
    /** Holds value of property availableOptions. */
    private Option[] availableOptions = null;
    /** Holds value of property selectedOptions. */
    private String[] selectedOptions = null;

    public Option[] getAvailableOptions() {
        int idPar = 0;
        nombrePar = "";
        lineaInvBO = new LineaInvestigacionBO();
        listaPares = new ArrayList<ParAcademicoVO>();
        try {
            listaPares = lineaInvBO.listarPersonaParAcademico();

            availableOptions = new Option[listaPares.size()];
            for (int i = 0; i < listaPares.size(); i++) {
                idPar = listaPares.get(i).getIdParAcademico();
                nombrePar = listaPares.get(i).getNombreParAcademico();
                availableOptions[i] = new Option(idPar, nombrePar);
            } // end for
        } catch (Exception e) {
            e.getStackTrace();
        }
        return availableOptions;
    }

    public void setAvailableOptions(Option[] availableOptions) {
        this.availableOptions = availableOptions;
    }

    public String[] getSelectedOptions() {
        return selectedOptions;
    }

    public void setSelectedOptions(String[] selectedOptions) {
        this.selectedOptions = selectedOptions;
    }
    private Table tableGrupo = new Table();

    public Table getTableGrupo() {
        return tableGrupo;
    }

    public void setTableGrupo(Table t) {
        this.tableGrupo = t;
    }
    private TableRowGroup tableRowGroup3 = new TableRowGroup();

    public TableRowGroup getTableRowGroup3() {
        return tableRowGroup3;
    }

    public void setTableRowGroup3(TableRowGroup trg) {
        this.tableRowGroup3 = trg;
    }
    private TableColumn tableColumn10 = new TableColumn();

    public TableColumn getTableColumn10() {
        return tableColumn10;
    }

    public void setTableColumn10(TableColumn tc) {
        this.tableColumn10 = tc;
    }
    private StaticText staticText9 = new StaticText();

    public StaticText getStaticText9() {
        return staticText9;
    }

    public void setStaticText9(StaticText st) {
        this.staticText9 = st;
    }
    private HtmlPanelGrid gridPanel54 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel54() {
        return gridPanel54;
    }

    public void setGridPanel54(HtmlPanelGrid hpg) {
        this.gridPanel54 = hpg;
    }
    private HtmlPanelGrid gridPanel55 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel55() {
        return gridPanel55;
    }

    public void setGridPanel55(HtmlPanelGrid hpg) {
        this.gridPanel55 = hpg;
    }
    private HtmlOutputText outputText18 = new HtmlOutputText();

    public HtmlOutputText getOutputText18() {
        return outputText18;
    }

    public void setOutputText18(HtmlOutputText hot) {
        this.outputText18 = hot;
    }
    private HtmlPanelGrid gridPanel4 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel4() {
        return gridPanel4;
    }

    public void setGridPanel4(HtmlPanelGrid hpg) {
        this.gridPanel4 = hpg;
    }
    private HtmlPanelGrid gridPanel56 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel56() {
        return gridPanel56;
    }

    public void setGridPanel56(HtmlPanelGrid hpg) {
        this.gridPanel56 = hpg;
    }
    private HtmlOutputText outputText19 = new HtmlOutputText();

    public HtmlOutputText getOutputText19() {
        return outputText19;
    }

    public void setOutputText19(HtmlOutputText hot) {
        this.outputText19 = hot;
    }
    private HtmlCommandButton buttonIrAnexar = new HtmlCommandButton();

    public HtmlCommandButton getButtonIrAnexar() {
        return buttonIrAnexar;
    }

    public void setButtonIrAnexar(HtmlCommandButton hcb) {
        this.buttonIrAnexar = hcb;
    }
    private HtmlInputHidden hiddenFieldIdAnexo = new HtmlInputHidden();

    public HtmlInputHidden getHiddenFieldIdAnexo() {
        return hiddenFieldIdAnexo;
    }

    public void setHiddenFieldIdAnexo(HtmlInputHidden hih) {
        this.hiddenFieldIdAnexo = hih;
    }
    private Hyperlink hyperlinkDownloadFile = new Hyperlink();

    public Hyperlink getHyperlinkDownloadFile() {
        return hyperlinkDownloadFile;
    }

    public void setHyperlinkDownloadFile(Hyperlink h) {
        this.hyperlinkDownloadFile = h;
    }
    private Tab tab3 = new Tab();

    public Tab getTab3() {
        return tab3;
    }

    public void setTab3(Tab t) {
        this.tab3 = t;
    }
    private PanelLayout layoutPanel4 = new PanelLayout();

    public PanelLayout getLayoutPanel4() {
        return layoutPanel4;
    }

    public void setLayoutPanel4(PanelLayout pl) {
        this.layoutPanel4 = pl;
    }
    private HtmlMessages messageList1 = new HtmlMessages();

    public HtmlMessages getMessageList1() {
        return messageList1;
    }

    public void setMessageList1(HtmlMessages hm) {
        this.messageList1 = hm;
    }
    private HtmlCommandButton button1 = new HtmlCommandButton();

    public HtmlCommandButton getButton1() {
        return button1;
    }

    public void setButton1(HtmlCommandButton hcb) {
        this.button1 = hcb;
    }
    private HtmlPanelGrid gridPanel5 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel5() {
        return gridPanel5;
    }

    public void setGridPanel5(HtmlPanelGrid hpg) {
        this.gridPanel5 = hpg;
    }
    private HtmlPanelGrid gridPanel57 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel57() {
        return gridPanel57;
    }

    public void setGridPanel57(HtmlPanelGrid hpg) {
        this.gridPanel57 = hpg;
    }
    private HtmlOutputText outputText20 = new HtmlOutputText();

    public HtmlOutputText getOutputText20() {
        return outputText20;
    }

    public void setOutputText20(HtmlOutputText hot) {
        this.outputText20 = hot;
    }
    private HtmlInputText textFieldIdLinea1 = new HtmlInputText();

    public HtmlInputText getTextFieldIdLinea1() {
        return textFieldIdLinea1;
    }

    public void setTextFieldIdLinea1(HtmlInputText hit) {
        this.textFieldIdLinea1 = hit;
    }
    private HtmlMessages messageList2 = new HtmlMessages();

    public HtmlMessages getMessageList2() {
        return messageList2;
    }

    public void setMessageList2(HtmlMessages hm) {
        this.messageList2 = hm;
    }
    private Tab tab4 = new Tab();

    public Tab getTab4() {
        return tab4;
    }

    public void setTab4(Tab t) {
        this.tab4 = t;
    }
    private PanelLayout layoutPanel2 = new PanelLayout();

    public PanelLayout getLayoutPanel2() {
        return layoutPanel2;
    }

    public void setLayoutPanel2(PanelLayout pl) {
        this.layoutPanel2 = pl;
    }
    private HtmlPanelGrid gridPanel48 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel48() {
        return gridPanel48;
    }

    public void setGridPanel48(HtmlPanelGrid hpg) {
        this.gridPanel48 = hpg;
    }
    private HtmlPanelGrid gridPanel49 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel49() {
        return gridPanel49;
    }

    public void setGridPanel49(HtmlPanelGrid hpg) {
        this.gridPanel49 = hpg;
    }
    private HtmlPanelGrid gridPanel58 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel58() {
        return gridPanel58;
    }

    public void setGridPanel58(HtmlPanelGrid hpg) {
        this.gridPanel58 = hpg;
    }
    private HtmlPanelGrid gridPanel59 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel59() {
        return gridPanel59;
    }

    public void setGridPanel59(HtmlPanelGrid hpg) {
        this.gridPanel59 = hpg;
    }
    private HtmlPanelGrid gridPanel60 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel60() {
        return gridPanel60;
    }

    public void setGridPanel60(HtmlPanelGrid hpg) {
        this.gridPanel60 = hpg;
    }
    private HtmlPanelGrid gridPanel61 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel61() {
        return gridPanel61;
    }

    public void setGridPanel61(HtmlPanelGrid hpg) {
        this.gridPanel61 = hpg;
    }
    private HtmlPanelGrid gridPanel62 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel62() {
        return gridPanel62;
    }

    public void setGridPanel62(HtmlPanelGrid hpg) {
        this.gridPanel62 = hpg;
    }
    private HtmlPanelGrid gridPanel63 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel63() {
        return gridPanel63;
    }

    public void setGridPanel63(HtmlPanelGrid hpg) {
        this.gridPanel63 = hpg;
    }
    private HtmlPanelGrid gridPanel64 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel64() {
        return gridPanel64;
    }

    public void setGridPanel64(HtmlPanelGrid hpg) {
        this.gridPanel64 = hpg;
    }
    private HtmlPanelGrid gridPanel65 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel65() {
        return gridPanel65;
    }

    public void setGridPanel65(HtmlPanelGrid hpg) {
        this.gridPanel65 = hpg;
    }
    private HtmlPanelGrid gridPanel66 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel66() {
        return gridPanel66;
    }

    public void setGridPanel66(HtmlPanelGrid hpg) {
        this.gridPanel66 = hpg;
    }
    private HtmlPanelGrid gridPanel67 = new HtmlPanelGrid();

    public HtmlPanelGrid getGridPanel67() {
        return gridPanel67;
    }

    public void setGridPanel67(HtmlPanelGrid hpg) {
        this.gridPanel67 = hpg;
    }
    private HtmlMessages messageList3 = new HtmlMessages();

    public HtmlMessages getMessageList3() {
        return messageList3;
    }

    public void setMessageList3(HtmlMessages hm) {
        this.messageList3 = hm;
    }
    private Table table1 = new Table();

    public Table getTable1() {
        return table1;
    }

    public void setTable1(Table t) {
        this.table1 = t;
    }
    private TableRowGroup tableRowGroup2 = new TableRowGroup();

    public TableRowGroup getTableRowGroup2() {
        return tableRowGroup2;
    }

    public void setTableRowGroup2(TableRowGroup trg) {
        this.tableRowGroup2 = trg;
    }
    private TableColumn tableColumn2 = new TableColumn();

    public TableColumn getTableColumn2() {
        return tableColumn2;
    }

    public void setTableColumn2(TableColumn tc) {
        this.tableColumn2 = tc;
    }
    private StaticText staticText1 = new StaticText();

    public StaticText getStaticText1() {
        return staticText1;
    }

    public void setStaticText1(StaticText st) {
        this.staticText1 = st;
    }
    private TableColumn tableColumn3 = new TableColumn();

    public TableColumn getTableColumn3() {
        return tableColumn3;
    }

    public void setTableColumn3(TableColumn tc) {
        this.tableColumn3 = tc;
    }
    private StaticText staticText2 = new StaticText();

    public StaticText getStaticText2() {
        return staticText2;
    }

    public void setStaticText2(StaticText st) {
        this.staticText2 = st;
    }
    private HtmlOutputText outputText15 = new HtmlOutputText();

    public HtmlOutputText getOutputText15() {
        return outputText15;
    }

    public void setOutputText15(HtmlOutputText hot) {
        this.outputText15 = hot;
    }
    private HtmlOutputText outputText21 = new HtmlOutputText();

    public HtmlOutputText getOutputText21() {
        return outputText21;
    }

    public void setOutputText21(HtmlOutputText hot) {
        this.outputText21 = hot;
    }
    private HtmlOutputText outputText22 = new HtmlOutputText();

    public HtmlOutputText getOutputText22() {
        return outputText22;
    }

    public void setOutputText22(HtmlOutputText hot) {
        this.outputText22 = hot;
    }
    private HtmlOutputText outputText23 = new HtmlOutputText();

    public HtmlOutputText getOutputText23() {
        return outputText23;
    }

    public void setOutputText23(HtmlOutputText hot) {
        this.outputText23 = hot;
    }
    private HtmlCommandButton buttonAgregarPares = new HtmlCommandButton();

    public HtmlCommandButton getButtonAgregarPares() {
        return buttonAgregarPares;
    }

    public void setButtonAgregarPares(HtmlCommandButton hcb) {
        this.buttonAgregarPares = hcb;
    }
    private HtmlCommandButton buttonVolver = new HtmlCommandButton();

    public HtmlCommandButton getButtonVolver() {
        return buttonVolver;
    }

    public void setButtonVolver(HtmlCommandButton hcb) {
        this.buttonVolver = hcb;
    }
    private HtmlInputText textFieldIdLinea2 = new HtmlInputText();

    public HtmlInputText getTextFieldIdLinea2() {
        return textFieldIdLinea2;
    }

    public void setTextFieldIdLinea2(HtmlInputText hit) {
        this.textFieldIdLinea2 = hit;
    }
    private HtmlInputText textFieldNombrePar = new HtmlInputText();

    public HtmlInputText getTextFieldNombrePar() {
        return textFieldNombrePar;
    }

    public void setTextFieldNombrePar(HtmlInputText hit) {
        this.textFieldNombrePar = hit;
    }
    private HtmlInputText textFieldIdPar = new HtmlInputText();

    public HtmlInputText getTextFieldIdPar() {
        return textFieldIdPar;
    }

    public void setTextFieldIdPar(HtmlInputText hit) {
        this.textFieldIdPar = hit;
    }
    private HtmlInputText textFieldAreaTrabajoPar = new HtmlInputText();

    public HtmlInputText getTextFieldAreaTrabajoPar() {
        return textFieldAreaTrabajoPar;
    }

    public void setTextFieldAreaTrabajoPar(HtmlInputText hit) {
        this.textFieldAreaTrabajoPar = hit;
    }
    private TableColumn tableColumn7 = new TableColumn();

    public TableColumn getTableColumn7() {
        return tableColumn7;
    }

    public void setTableColumn7(TableColumn tc) {
        this.tableColumn7 = tc;
    }
    private Button buttonEliminarPar = new Button();

    public Button getButtonEliminarPar() {
        return buttonEliminarPar;
    }

    public void setButtonEliminarPar(Button b) {
        this.buttonEliminarPar = b;
    }
    private HtmlMessages messageList4 = new HtmlMessages();

    public HtmlMessages getMessageList4() {
        return messageList4;
    }

    public void setMessageList4(HtmlMessages hm) {
        this.messageList4 = hm;
    }
    private HtmlCommandButton buttonVerPares = new HtmlCommandButton();

    public HtmlCommandButton getButtonVerPares() {
        return buttonVerPares;
    }

    public void setButtonVerPares(HtmlCommandButton hcb) {
        this.buttonVerPares = hcb;
    }
    private HtmlOutputText outputText25 = new HtmlOutputText();

    public HtmlOutputText getOutputText25() {
        return outputText25;
    }

    public void setOutputText25(HtmlOutputText hot) {
        this.outputText25 = hot;
    }

    // </editor-fold>
    /**
     * <p>Construct a new Page bean instance.</p>
     */
    public ConsultarLinea() {
        this.cargarVariablesSesion();
    }


    public void cargarVariablesSesion(){
        if(this.getSession().getAttribute(ID_SESSION_CONSULTAR_LINEA+"optionsPersonas")!=null){
            this.setOptionsPersonas((Option[]) this.getSession().getAttribute(ID_SESSION_CONSULTAR_LINEA+"optionsPersonas"));
        }
    }

    /**
     * <p>Callback method that is called whenever a page is navigated to,
     * either directly via a URL, or indirectly via page navigation.
     * Customize this method to acquire resources that will be needed
     * for event handlers and lifecycle methods, whether or not this
     * page is performing post back processing.</p>
     * 
     * <p>Note that, if the current request is a postback, the property
     * values of the components do <strong>not</strong> represent any
     * values submitted with this request.  Instead, they represent the
     * property values that were saved for this view when it was rendered.</p>
     */
    @Override
    public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here

        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("ConsultarLinea Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e : new FacesException(e);
        }

        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
        //List listaLineas = this.listaLinea.getList();
        try {
            LineaInvestigacionVO lineaInvestigacionVO = getRequestBean1().getLineaInvVO();
            lineaInvVO = new LineaInvestigacionVO();
            lineaInvTO = new LineaInvestigacionTO();
            grupoInvVO = new GrupoInvestigacionVO();
            if (lineaInvestigacionVO.getIdLinea() != 0) {
                lineaInvTO = lineaInvBO.consultarLineaPK(lineaInvestigacionVO);
                lineaInvVO = lineaInvTO.getLineaInvestigacionVO();
                //grupoInvVO = lineaInvTO.getGrupoInvestigacionVO();
                hiddenIdLinea.setValue(lineaInvVO.getIdLinea());
                areaNombreLinea.setValue(lineaInvVO.getNombreLinea());
                areaJustificacion.setValue(lineaInvVO.getJustificacionLinea());
                areaPosProy.setValue(lineaInvVO.getPosibilidadesProyeccion());
                areaPersEpist.setValue(lineaInvVO.getPersEpistemologica());
                textFieldFecha1.setValue(lineaInvVO.getFechaRegistro());
            }
        } catch (Exception e) {
            // print exception information in the server log
            log("Exception Message!!!", e);
        // view log messages using View Server Log menu item
        // on the Deployment Server node in the Server Navigator
        // TODO: either handle the exception or pass it to the Faces layer
        // throw new FacesException(e);
        }
    }

    /**
     * <p>Callback method that is called after the component tree has been
     * restored, but before any event processing takes place.  This method
     * will <strong>only</strong> be called on a postback request that
     * is processing a form submit.  Customize this method to allocate
     * resources that will be required in your event handlers.</p>
     */
    @Override
    public void preprocess() {
    }

    /**
     * <p>Callback method that is called just before rendering takes place.
     * This method will <strong>only</strong> be called for the page that
     * will actually be rendered (and not, for example, on a page that
     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
     */
    @Override
    public void prerender() {
    }

    /**
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called (regardless of whether
     * or not this was the page that was actually rendered).  Customize this
     * method to release resources acquired in the <code>init()</code>,
     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
     * acquired during execution of an event handler).</p>
     */
    @Override
    public void destroy() {
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected SessionBean1 getSessionBean1() {
        return (SessionBean1) getBean("SessionBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected RequestBean1 getRequestBean1() {
        return (RequestBean1) getBean("RequestBean1");
    }

    /**
     * <p>Return a reference to the scoped data bean.</p>
     *
     * @return reference to the scoped data bean
     */
    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1) getBean("ApplicationBean1");
    }
    private String nombreLinea = "";
    private DropDown dropDownPersonas = new DropDown();
    private Option[] optionsPersonas;
    private List<LineaInvestigacionVO> listaLinea = new ArrayList<LineaInvestigacionVO>();
    private List<ParAcademicoVO> listaPares = new ArrayList<ParAcademicoVO>();
    private List<GrupoInvestigacionVO> listaGrupo = new ArrayList<GrupoInvestigacionVO>();
    private LineaInvestigacionVO lineaInvVO = new LineaInvestigacionVO();
    private LineaInvestigacionBO lineaInvBO = new LineaInvestigacionBO();
    private ArchivoVO archivoVO;
    private GrupoInvestigacionVO grupoInvVO;
    private LineaInvestigacionTO lineaInvTO;
    private ParAcademicoVO parAcademicoVO;
    private int idLinea = 0,  idEvento = 0,  idParAcademico = 0;
    private String justificacion = "",  proyeccion = "",  persEpistemologica = "",  resultado = "",  resultadoParticipantes = "",  areaTrabajoPar = "";
    private String nombreArchivo = "",  descripcionArchivo = "",  rutaArchivo = "",  nombrePar = "";
    private Date fechaArchivo = null;
    private HttpSession session;
    private static final String ID_SESSION_CONSULTAR_LINEA = "consultar.linea";

    /**
     * Elaborado por Jimmy Ramírez Duque, 29 de Septiembre de 2009
     * Carga las personas para la lista desplegable dropDownPersonas
     */
    public void cargarOptionsPersonas(){
        List<PersonaVO> list = new ArrayList<PersonaVO>();
        lineaInvBO = new LineaInvestigacionBO();
        try {
            list = lineaInvBO.obtenerParesAcademicos();
            if(list.size()!=0){
                optionsPersonas = new Option[list.size()+1];
                optionsPersonas[0] = new Option("0", "Seleccione Una Persona");
                for(int i=0;i<list.size();i++){
                    optionsPersonas[i+1] = new Option(list.get(i).getIdPersona(), list.get(i).getNombrePersona());
                }
            }else{
                optionsPersonas[0] = new Option("0", "No Hay personas");
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            Logger.getLogger(ConsultarLinea.class.getName()).log(Level.SEVERE, null, ex);
            error("Error al Cargar las personas");
        }
    }

    public String buttonConsultarLinea_action() throws Exception {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.        
        try {
            tablaLineas.setRendered(true);
            lineaInvVO = new LineaInvestigacionVO();
            lineaInvBO = new LineaInvestigacionBO();
            listaLinea = new ArrayList<LineaInvestigacionVO>();
            String lineaId = (String) textFieldIdLinea1.getValue();
            nombreLinea = (String) textFieldNombre.getValue();
            lineaInvVO.setIdBusqueda(lineaId);
            lineaInvVO.setNombreLinea(nombreLinea);
            listaLinea = lineaInvBO.consultarLineaInv(lineaInvVO);
            getSessionBean1().addListalineas(listaLinea);
        } catch (Exception ce) {
            error("Error al consultar el grupo de investigación.");
            ce.getStackTrace();
        }
        return null;
    }

    public String botonVer_action() {
        // TODO: Process the action. Return value is a navigation
        // case name where null will return to the same page.
        lineaInvBO = new LineaInvestigacionBO();
        lineaInvVO = new LineaInvestigacionVO();
        grupoInvVO = new GrupoInvestigacionVO();
        listaPares = new ArrayList<ParAcademicoVO>();
        listaGrupo = new ArrayList<GrupoInvestigacionVO>();
        lineaInvTO = new LineaInvestigacionTO();
        archivoVO = new ArchivoVO();

        //int idLinea=0;
        LineaInvestigacionVO lineaInvestigacionVO = new LineaInvestigacionVO();
        // Try Catch Exception
        // This clip shows how to create a try/catch
        // statement to handle possible exceptions
        try {
            idLinea = (Integer) getValue("#{currentRow.value['idLinea']}");
            lineaInvVO.setIdLinea(idLinea);
            lineaInvTO = lineaInvBO.consultarLineaPK(lineaInvVO);
            lineaInvestigacionVO = lineaInvTO.getLineaInvestigacionVO();
            listaGrupo = lineaInvTO.getGrupoInvestigacionVO();
            //grupoInvVO = lineaInvTO.getGrupoInvestigacionVO();
            hiddenIdLinea.setValue(lineaInvestigacionVO.getIdLinea());
            textFieldIdLinea2.setValue(lineaInvestigacionVO.getIdLinea());
            areaNombreLinea.setValue(lineaInvestigacionVO.getNombreLinea());
            areaJustificacion.setValue(lineaInvestigacionVO.getJustificacionLinea());
            areaPosProy.setValue(lineaInvestigacionVO.getPosibilidadesProyeccion());
            areaPersEpist.setValue(lineaInvestigacionVO.getPersEpistemologica());
            textFieldFecha1.setValue(lineaInvestigacionVO.getFechaRegistro());

            textFieldIdLinea.setValue(lineaInvestigacionVO.getIdLinea());
            textAreaNombreLinea.setValue(lineaInvestigacionVO.getNombreLinea());

            listaPares = lineaInvBO.consultarPares(lineaInvVO);
            getSessionBean1().addListaPares(listaPares);

            getSessionBean1().addListaGrupos(listaGrupo);

            archivoVO = lineaInvBO.consultarArchivo(lineaInvVO);
            if (archivoVO.getNombreArchivo().equals("")) {
                hyperlinkDownloadFile.setText("Vacio");
            } else {
                hiddenFieldIdAnexo.setValue(archivoVO.getRutaArchivo());
                hyperlinkDownloadFile.setText(archivoVO.getNombreArchivo());
                hyperlinkDownloadFile.setDisabled(false);
            }
            tabSet1.setSelected(tab3.getId().toString());

        } catch (Exception e) {
            // print exception information in the server log
            error("Exception Message!!!" + e);
        // view log messages using View Server Log menu item
        // on the Deployment Server node in the Server Navigator
        // TODO: either handle the exception or pass it to the Faces layer
        // throw new FacesException(e);
        }
        return null;
    }

    public String buttonAdministrar_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        lineaInvVO = new LineaInvestigacionVO();
        idLinea = (Integer) hiddenIdLinea.getValue();
        lineaInvVO.setIdLinea(idLinea);
        getRequestBean1().setLineaInvVO(lineaInvVO);
        return "administrarLinea";
    }

    public String buttonActualizar_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        try {
            lineaInvVO = new LineaInvestigacionVO();
            lineaInvBO = new LineaInvestigacionBO();
            idLinea = (Integer) hiddenIdLinea.getValue();
            justificacion = (String) areaJustificacion.getValue();
            proyeccion = (String) areaPosProy.getValue();
            nombreLinea = (String) areaNombreLinea.getValue();

            persEpistemologica = (String) areaPersEpist.getValue();
            if (justificacion == null || justificacion.equals("")) {
                error("Por favor digite la Justificación de la línea de investigación.");
                return null;
            } else if (proyeccion == null || proyeccion.equals("")) {
                error("Por favor digite la Proyección de la línea de investigación.");
                return null;
            } else if (persEpistemologica == null || persEpistemologica.equals("")) {
                error("Por favor digite la Perspectiva Epistemologica de la línea de investigación.");
                return null;
            }
            lineaInvVO.setIdLinea(idLinea);
            lineaInvVO.setJustificacionLinea(justificacion);
            lineaInvVO.setPosibilidadesProyeccion(proyeccion);
            lineaInvVO.setPersEpistemologica(persEpistemologica);
            resultado = lineaInvBO.modificarLinea(lineaInvVO);
            if (!resultado.equals("modifico")) {
                error("error al modificar");
            } else {
                info("La línea de investigación se ha modificado correctamente.");
                textFieldIdLinea.setValue(idLinea);
                textAreaNombreLinea.setValue(nombreLinea);
            }

        } catch (Exception e) {
            System.err.println(e.toString());
            error("error al modificar la linea de investigación.");
        }
        return null;
    }

    public String botonAdjuntar_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        UploadedFile uploadedFile = this.fileUploadLinea.getUploadedFile();
        Archivo archivo = new Archivo();
        if(uploadedFile != null){
        if (uploadedFile.getContentType().equals("application/pdf")) {
            try {
                ServletContext context = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
                String path = context.getRealPath("/") + PATH_UPLOAD_LINEAS_INV;
                nombreArchivo = textFieldNombreArchivo.getValue().toString();
                archivo.uploadFile(uploadedFile, nombreArchivo, path);
                textFieldArchivo.setValue(path + textFieldNombreArchivo.getValue().toString() + ".pdf");
            } catch (ArchivoException ex) {
                Logger.getLogger(FormularLinea.class.getName()).log(Level.SEVERE, null, ex);
                ex.printStackTrace();
                error("Error al adjunta el archivo");
            }

        } else {
            error("Solo se admiten archivos en formato PDF");
        }
          }else{
            error("El máximo tamaño permitido es de 10MB");
        }
        return null;
    }

    public String botonGuardar_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        archivoVO = new ArchivoVO();
        int resultados = 0;
        try {
            lineaInvBO = new LineaInvestigacionBO();
            idLinea = (Integer) textFieldIdLinea.getValue();
            nombreArchivo = (String) textFieldNombreArchivo.getValue();
            descripcionArchivo = (String) textAreaDescripcion.getValue();
            rutaArchivo = (String) textFieldArchivo.getValue();
            fechaArchivo = (Date) textFieldFecha.getValue();

            if (idLinea == 0) {
                error("no hay una Línea vinculada.");
                return null;
            } else if (nombreArchivo == null || nombreArchivo.equals("")) {
                error("Por favor digíte el nombre del del archivo.");
                return null;
            } else if (descripcionArchivo == null || descripcionArchivo.equals("")) {
                error("Por favor digite la descripción del archivo.");
                return null;
            } else if (rutaArchivo == null || rutaArchivo.equals("")) {
                error("No se ha adjuntado el archivo.");
                return null;
            } else if (fechaArchivo == null) {
                error("Fallo al obtener la fecha.");
                return null;
            }
            archivoVO.setIdModulo(idLinea);
            archivoVO.setNombreArchivo(nombreArchivo);
            archivoVO.setDescripcion(descripcionArchivo);
            archivoVO.setRutaArchivo(rutaArchivo);
            archivoVO.setFechaArchivo(fechaArchivo);
            resultados = lineaInvBO.guardarArchivoLinea(archivoVO);

            if (resultados == 0) {
                error("Error al guardar el anexo");
            } else {
                info("El archivo se guardo correctamente");
            }
        } catch (Exception e) {
            error("Error al guardar el anexo" + e);
            e.getStackTrace();
        }
        return null;
    }

    public String buttonIrAnexar_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        tabSet1.setSelected(tab2.getId().toString());
        return null;
    }

    public String botonVolver_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        tabSet1.setSelected(tab3.getId().toString());
        return null;
    }

    public String hyperlinkDownloadFile_action() {
        try {
            String archivoLinea = (String) hiddenFieldIdAnexo.getValue();
            nombreArchivo = hyperlinkDownloadFile.getText().toString();
            ServletContext context = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
            String path = context.getRealPath("/") + PATH_UPLOAD_LINEAS_INV + "\\" + nombreArchivo + ".pdf";
            if (archivoLinea.equals("")) {
                error("No hay anexos");
                return null;
            }
            Archivo arc = new Archivo();
            arc.downloadFile(nombreArchivo, path);
            return null;
        } catch (ArchivoException ex) {
            Logger.getLogger(ConsultarLinea.class.getName()).log(Level.SEVERE, null, ex);
            ex.printStackTrace();
            error("Error al descargar archivo");
        }
        return null;
    }

    public String button1_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        tabSet1.setSelected(tab1.getId().toString());
        return null;
    }

    public String buttonVolver_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        tabSet1.setSelected(tab3.getId().toString());
        return null;
    }

    public String buttonAgregarPares_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
        int resultados = 0;
        int idPar = 0;
        try {
            // TODO: Insert logic that may cause an exception
            // for example, performing database logic or file access
            parAcademicoVO = new ParAcademicoVO();
            lineaInvVO = new LineaInvestigacionVO();
            lineaInvBO = new LineaInvestigacionBO();

            idLinea = (Integer) textFieldIdLinea.getValue();
            nombrePar = (String) textFieldNombrePar.getValue();
            String parId = (String) textFieldIdPar.getValue();
            areaTrabajoPar = (String) textFieldAreaTrabajoPar.getValue();

            if (nombrePar == null || nombrePar.equals("")) {
                error("Por favor digite el nombre del par academico.");
                return null;
            } else if (esNumero(parId) == false) {
                error("Por favor digite la identificación del par academico.");
                return null;
            } else if (areaTrabajoPar == null || areaTrabajoPar.equals("")) {
                error("Por favor digite el area de trabajo del par academico.");
                return null;
            }

            idPar = Integer.parseInt(parId);
            lineaInvVO.setIdLinea(idLinea);
            parAcademicoVO.setNombreParAcademico(nombrePar);
            parAcademicoVO.setIdParAcademico(idPar);
            parAcademicoVO.setAreaTrabajoPar(areaTrabajoPar);
            //lineaInvVO.setIdLinea(idLine);                
            lineaInvBO.insertarParesAcademicos(parAcademicoVO, lineaInvVO);
            
                info("El par academico se ingresó correctamente");
                textFieldNombrePar.setValue("");
                textFieldIdPar.setValue("");
                textFieldAreaTrabajoPar.setValue("");
                listaPares = lineaInvBO.consultarPares(lineaInvVO);
            getSessionBean1().addListaPares(listaPares);
            

        } catch (Exception e) {
            // print exception information in the server log
            error("error al ingresar los pares. ");
            log("Exception Message!!!", e);
        }
        return null;
    }

    private static boolean esNumero(String cadena) {
        try {
            Integer.parseInt(cadena);
            return true;
        } catch (NumberFormatException nfe) {
            return false;
        }
    }

    public String buttonEliminarPar_action() {
        // TODO: Replace with your code
        String resp = "";
        ListaTablaPares listaTablaPares = getSessionBean1().getListaTablaPares();
        try {
            RowKey rowToRemove = tableRowGroup2.getRowKey();
            lineaInvVO = new LineaInvestigacionVO();
            parAcademicoVO = new ParAcademicoVO();
            lineaInvBO = new LineaInvestigacionBO();
            idParAcademico = (Integer) getValue("#{currentRow.value['idParAcademico']}");
            idLinea = (Integer) textFieldIdLinea2.getValue();
            lineaInvVO.setIdLinea(idLinea);
            parAcademicoVO.setIdParAcademico(idParAcademico);
            resp = lineaInvBO.eliminarParesAcademicos(lineaInvVO, parAcademicoVO);
            if (resp.equals("elimino")) {
                listaTablaPares.removeRow(rowToRemove);
                listaTablaPares.commitChanges();
                info("Se eliminó correctamente.");
            } else {
                error("Error al eliminar el par academico.");
            }
        } catch (Exception ce) {
            listaTablaPares.revertChanges();
            error("Error al consultar el grupo de investigación.");
            ce.getStackTrace();
        }
        return null;
    }

    public String buttonVerPares_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.

        this.cargarOptionsPersonas();
        this.getSession().setAttribute(ID_SESSION_CONSULTAR_LINEA+"optionsPersonas", this.getOptionsPersonas());
        tabSet1.setSelected(tab4.getId().toString());
        return null;
    }

    public String actionDropDownPersonas(ValueChangeEvent vce){
        if(!dropDownPersonas.getValue().toString().equals("0")){
        this.textFieldIdPar.setValue(dropDownPersonas.getValue().toString());
        for(int i=0;i<optionsPersonas.length;i++){
            if(dropDownPersonas.getValue().equals(optionsPersonas[i].getValue())){
                this.textFieldNombrePar.setValue(optionsPersonas[i].getLabel());
            }
        }
        }else{
            this.textFieldIdPar.setValue("");
            this.textFieldNombrePar.setValue("");
        }
        return null;
    }

    public DropDown getDropDownPersonas() {
        return dropDownPersonas;
    }

    public void setDropDownPersonas(DropDown dropDownPersonas) {
        this.dropDownPersonas = dropDownPersonas;
    }

    public Option[] getOptionsPersonas() {
        return optionsPersonas;
    }

    public void setOptionsPersonas(Option[] optionsPersonas) {
        this.optionsPersonas = optionsPersonas;
    }

    public HttpSession getSession() {
        return (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
    }

    public void setSession(HttpSession session) {
        this.session = session;
    }

    
}

